<?
	set_time_limit(0);	
	$name_arch='../lid/tmp/plugins.zip';
	require_once 'pclzip.lib.php';

	//echo $filesdir=trim(realpath(dirname($_SERVER['SCRIPT_FILENAME'])),'/');
	$files_to_arch=array();
	$filesdir='.';

	for($d=@opendir($filesdir);$file=@readdir($d);)
		{      
		    if($file!='.' && $file!='..' && $file!='..') 
		        $files_to_arch[]=str_replace('./','',$filesdir.'/'.$file);
		}

	$archive=new PclZip($name_arch);

	//$v_list=$archive->create(implode(',',$files_to_arch),
	//                        PCLZIP_OPT_REMOVE_PATH,
	//                        $filesdir);

	$v_list=$archive->create(implode(',',$files_to_arch));

	if($v_list==0) {
	   die("Error : ".$archive->errorInfo(true));
	} else {
	   echo 'OK';
	}
?>
